# coding: utf-8
from util import (
				udpSocketServer, 
				logging,
				sysEncode,
				)


def main():
	"""
	
	接受客户端的请求信息, 并小写字母转成大写字母, 返回
	"""
	s = udpSocketServer()
	
	while True:
		data, addr = s.recvfrom(1024)   #获得数据和客户端的地址与端口,一次最大接收1024字节
		
		logging.info(sysEncode('Received from %s:%s.' % addr))

		s.sendto(data.decode('utf-8').upper().encode(), addr)#将数据变成大写送回客户端


if __name__ == '__main__':
	main()